/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.util.Date;

/**
 * @author Triumphsys
 */
public class CMValuationProposalClp extends BaseModelImpl<CMValuationProposal>
	implements CMValuationProposal {
	public CMValuationProposalClp() {
	}

	public long getPrimaryKey() {
		return _valuationProposalId;
	}

	public void setPrimaryKey(long pk) {
		setValuationProposalId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_valuationProposalId);
	}

	public long getValuationProposalId() {
		return _valuationProposalId;
	}

	public void setValuationProposalId(long valuationProposalId) {
		_valuationProposalId = valuationProposalId;
	}

	public Date getCodCcmDt() {
		return _codCcmDt;
	}

	public void setCodCcmDt(Date codCcmDt) {
		_codCcmDt = codCcmDt;
	}

	public String getApprovalTl() {
		return _approvalTl;
	}

	public void setApprovalTl(String approvalTl) {
		_approvalTl = approvalTl;
	}

	public long getLoanAmt() {
		return _loanAmt;
	}

	public void setLoanAmt(long loanAmt) {
		_loanAmt = loanAmt;
	}

	public String getProposalName() {
		return _proposalName;
	}

	public void setProposalName(String proposalName) {
		_proposalName = proposalName;
	}

	public long getReportingAId1() {
		return _reportingAId1;
	}

	public void setReportingAId1(long reportingAId1) {
		_reportingAId1 = reportingAId1;
	}

	public long getReportingAId2() {
		return _reportingAId2;
	}

	public void setReportingAId2(long reportingAId2) {
		_reportingAId2 = reportingAId2;
	}

	public String getModel() {
		return _model;
	}

	public void setModel(String model) {
		_model = model;
	}

	public long getProposalId() {
		return _proposalId;
	}

	public void setProposalId(long proposalId) {
		_proposalId = proposalId;
	}

	public CMValuationProposal toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (CMValuationProposal)Proxy.newProxyInstance(CMValuationProposal.class.getClassLoader(),
				new Class[] { CMValuationProposal.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		CMValuationProposalClp clone = new CMValuationProposalClp();

		clone.setValuationProposalId(getValuationProposalId());
		clone.setCodCcmDt(getCodCcmDt());
		clone.setApprovalTl(getApprovalTl());
		clone.setLoanAmt(getLoanAmt());
		clone.setProposalName(getProposalName());
		clone.setReportingAId1(getReportingAId1());
		clone.setReportingAId2(getReportingAId2());
		clone.setModel(getModel());
		clone.setProposalId(getProposalId());

		return clone;
	}

	public int compareTo(CMValuationProposal cmValuationProposal) {
		int value = 0;

		if (getValuationProposalId() < cmValuationProposal.getValuationProposalId()) {
			value = -1;
		}
		else if (getValuationProposalId() > cmValuationProposal.getValuationProposalId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMValuationProposalClp cmValuationProposal = null;

		try {
			cmValuationProposal = (CMValuationProposalClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmValuationProposal.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(19);

		sb.append("{valuationProposalId=");
		sb.append(getValuationProposalId());
		sb.append(", codCcmDt=");
		sb.append(getCodCcmDt());
		sb.append(", approvalTl=");
		sb.append(getApprovalTl());
		sb.append(", loanAmt=");
		sb.append(getLoanAmt());
		sb.append(", proposalName=");
		sb.append(getProposalName());
		sb.append(", reportingAId1=");
		sb.append(getReportingAId1());
		sb.append(", reportingAId2=");
		sb.append(getReportingAId2());
		sb.append(", model=");
		sb.append(getModel());
		sb.append(", proposalId=");
		sb.append(getProposalId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(31);

		sb.append("<model><model-name>");
		sb.append(
			"com.triumphsys.icici.cmeeting.portlet.model.CMValuationProposal");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>valuationProposalId</column-name><column-value><![CDATA[");
		sb.append(getValuationProposalId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>codCcmDt</column-name><column-value><![CDATA[");
		sb.append(getCodCcmDt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvalTl</column-name><column-value><![CDATA[");
		sb.append(getApprovalTl());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>loanAmt</column-name><column-value><![CDATA[");
		sb.append(getLoanAmt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalName</column-name><column-value><![CDATA[");
		sb.append(getProposalName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>reportingAId1</column-name><column-value><![CDATA[");
		sb.append(getReportingAId1());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>reportingAId2</column-name><column-value><![CDATA[");
		sb.append(getReportingAId2());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>model</column-name><column-value><![CDATA[");
		sb.append(getModel());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalId</column-name><column-value><![CDATA[");
		sb.append(getProposalId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _valuationProposalId;
	private Date _codCcmDt;
	private String _approvalTl;
	private long _loanAmt;
	private String _proposalName;
	private long _reportingAId1;
	private long _reportingAId2;
	private String _model;
	private long _proposalId;
}